package com.atguigu.boot.admin.mapper;

import com.atguigu.boot.admin.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @author : leimingchao
 * @date Date : 2021年11月21日 14:44
 */
// @Mapper
public interface CityMapper {

    @Select(value = "select * from city where id = #{id}")
    City getCityById(Long id);

    @Insert(value = "insert into city(name,state,country) values (#{name},#{state},#{country})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void insert(City city);
}
